import os
import uiautomation
from config.config import DATA_PATH
from page.index import IndexPage
from page.收费管理.huajiashoufei__page import huajiashoufei
from tools.sjqd_way import read_data_from_excel
class Tiaoshi():
    his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
    his.SetFocus()
    def huajiashoufei(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        ap = IndexPage()
        bp = huajiashoufei()
        ap.click_sfgl_btn()#点击收费管理
        ap.click_hjsf_btn()#点击划价收费
        bp.click_jmcflb_btn()#点击居民处方列表
        bp.input_lbxm(name)#输入列表姓名
        bp.click_cx_btn()#点击查询按钮
        bp.click_sj1()#选择第一条处方
        bp.click_qd_btn()#点击确定按钮
        # bp.input_yhjm('15')#输入优惠减免
        bp.click_xjzf_btn()#点击现金支付
        bp.click_sfbc_btn()#点击收费保存
        bp.click_ylgb_btn()#点击预览关闭按钮

if __name__ == '__main__':
    Tiaoshi().huajiashoufei()

